Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

feat: Allow customizing written log entries by exposing parameters via appender configuration - #625

Merged
losalex merged 40 commits into
mainfrom
losalex/fix-551
Jan 14, 2022
Merged

feat: Allow customizing written log entries by exposing parameters via appender configuration#625
losalex merged 40 commits into
mainfrom
losalex/fix-551

Conversation

@losalex

@losalex losalex commented Jan 6, 2022

Copy link
Copy Markdown
Contributor

This feature enables customizing logs destination by setting project/folder/organization/billing destinations (see more details under logName field).

Fixes #551 ☕️

@losalex
losalex requested review from a team and minherz January 6, 2022 00:47
@product-auto-label product-auto-label Bot added size: s Pull request size is small. api: logging Issues related to the googleapis/java-logging-logback API. labels Jan 6, 2022

@minherz minherz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a couple of discrepancies that worth addressing before the merge.
between two options to configure project id: using LoggingOptions or providing the project id with WriteOption, please consider selecting one.

Comment thread src/main/java/com/google/cloud/logging/logback/LoggingAppender.java Outdated
loggingOptions = LoggingOptions.getDefaultInstance();
} else {
LoggingOptions.Builder builder = LoggingOptions.newBuilder();
builder.setProjectId(projectId);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since the project id is already set via WriteOption there is no need to set it also using LoggingOptions.
I suggest to choice either method but not both.

@losalex losalex Jan 11, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The projectId provided through setProjectId() overrides the one from credentials. If projectId was not set through setProjectId(), the one from credentials will be used

losalex and others added 17 commits January 12, 2022 00:10

@minherz minherz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

Comment thread README.md
Comment on lines +99 to +101
<!-- Optional: defaults to the project id obtained during authentication process. Project id is also used to construct resource name of the log entries -->
<logDestinationProjectId>String</logDestinationProjectId>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this change is done by you, please undo it to avoid unnecessary PRs since the change to .readme-partials.yaml does the job.
If this change is submitted by Owlbot, please ignore this comment.

@losalex
losalex merged commit 87d259f into main Jan 14, 2022
@losalex
losalex deleted the losalex/fix-551 branch January 14, 2022 20:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: logging Issues related to the googleapis/java-logging-logback API. size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow customizing written log entries by exposing parameters via appender configuration

3 participants